package com.example.spring.framework.util;

/**
 * @Classname StringUtils
 * @Date 2019/5/4 14:33
 * @Author admin
 * @Description TODO
 */
public abstract class StringUtils {

    public static boolean isEmpty(Object str) {
        return (str == null || "".equals(str));
    }

    public static boolean isNotEmpty(Object str) {
        return !(str == null || "".equals(str));
    }

    public static boolean isBlank(String str) {
        return (str == null || "".equals(str) || "".equals(str.trim()));
    }

    public static boolean isNotBlank(String str) {
        return !(str == null || "".equals(str) || "".equals(str.trim()));
    }

    public static String toLowerFirstCase(String str) {
        char [] chars = str.toCharArray();
        //之所以加，是因为大小写字母的ASCII码相差32，
        // 而且大写字母的ASCII码要小于小写字母的ASCII码
        //在Java中，对char做算学运算，实际上就是对ASCII码做算学运算
        chars[0] += 32;
        return String.valueOf(chars);
    }

}
